﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Xqsys.DAL
{
    public class ProgramType
    {
        /// <summary>
        /// 上传新类型
        /// </summary>
        /// <param name="programType"></param>
        /// <returns></returns>
        public bool AddProgramType(MODEL.ProgramType programType)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@name",programType.Name),
                new SqlParameter("@text",programType.Text)
            };
            return COM.SqlHelper.ExecuteNonQuery("sp_AddProgram", param);
        }
        /// <summary>
        /// 提交新类型
        /// </summary>
        /// <param name="programType"></param>
        /// <returns>bool 成功与否</returns>
        public bool UpdateProgram(MODEL.ProgramType programType)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@Typeid",programType.TypeID),
                new SqlParameter("@name",programType.Name),
                new SqlParameter("@text",programType.Text)
            };
            return COM.SqlHelper.ExecuteNonQuery("sp_UpdateProgram", param);
        }
    }
}
